package run.siyuan.jdk.设计模式.代理模式.代理模式案例3;


/**
 * @className: GamePlayerProxy
 * @Description: TODO 代理模式-普通代理-代练者
 * @author: siyuan
 * @date: 2022/3/17 11:33 AM
 */
public class GamePlayerProxy implements IGamePlayer {
    private IGamePlayer gamePlayer = null;

    //构造函数传递用户名
    public GamePlayerProxy(IGamePlayer _gamePlayer) {
        this.gamePlayer = _gamePlayer;
    }

    //代练杀怪
    public void killBoss() {
        this.gamePlayer.killBoss();
    }

    //代练登录
    public void login(String user, String password) {
        this.gamePlayer.login(user, password);
    }

    //代练升级
    public void upgrade() {
        this.gamePlayer.upgrade();
    }

    //代理的代理暂时还没有，就是自己
    public IGamePlayer getProxy() {
        return this;
    }
}